home *** CD-ROM | disk | FTP | other *** search
- Adding to your PATH
-
- (* The following is from 'Exchange of IBM PC Information', *)ì
- (* July/August 1986 from an article by Mark Chance *)
-
- (**NOTE: This method of adding to your PATH is NOT DOCUMENTED in **)
- (** the DOS Reference manual and is NOT SUPPORTED by IBM. **)
-
-
- When processing a BATch file, DOS (version 2.00 and higher) has an
- interesting way of accessing the information you have placed in the
- environment space using the DOS SET command. If you use the SET
- command from within a BATch file to set XXX to YYY:
-
- SET XXX=YYY
-
- and then enter the XXX variable from within another BATch command as
- shown below:
-
- ECHO %XXX%
-
- then DOS returns YYY.
-
- Using this information, you can create a BATch file that will add a
- single directory to your existing PATH statement without your havingì
- to re-enter each directory currently in the PATH. First, you createì
- a BATch file (I named mine ADDPATH.BAT) that contains the followingì
- command:ì
-
- PATH %1;%PATH%
-
- If you create this BATch file using the COPY CON: command. type theì
- lines shown below from the keyboard. The word "enter" in bracketsì
- means you press the Enter key at the end of the line; the F6 meansì
- you press Function Key 6.
-
- COPY CON: ADDPATH.BAT <Enter>
- PATH %1;%PATH% <Enter>
- F6 <Enter>
-
- Suppose your current path contains the following directories:
-
- PATH C:\;C:\DOS;C:\UTIL;
-
- And you wish to add the directory c:\APPS to the path. You simplyì
- enter the following command at the DOS prompt:ì
-
- ADDPATH C:\APPS
-
- The PATH would become
-
- PATH C:\APPS;C:\;C:\DOS;C:\UTIL;
-
- If you wish to add the directory to your path temporarily, you mightì
- consider loading COMMAND.COM as a second level command processorì
- before you enter the ADDPATH statement:ì
-
- COMMAND
- ADDPATH C:\APPS
-
- The new path will be valid as long as you operate under the secondì
- level command processor. When you enter "EXIT" and return to the firstì
- level command processor (loaded when you booted DOS), the original
- PATH would again be valid.
-